package com.yuan.spring.io;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * Created by 袁恩光 on 2017/11/15.
 */
@PropertySource("classpath:demo/propertiestest.properties")
@Component
public class PropertiesTest {

    @Autowired
    Environment env;


    private String a;

    public String getA() {
        System.out.println(env.getProperty("a"));
        return a;
    }

    public void setA(String a) {
        this.a = a;
    }
}
